/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package HTML;

/**
 *
 * @author Jhon
 */
public class HtmlSideBar {
    private String bar;
    private String mal;
    public HtmlSideBar(boolean log){
        mal="";
        if(log){
            bar="<div id=\"sectionLinks\"> \n" +
                "<center><img src=\"/OnlineJudge-war/Images/main.png\">\n" +
                "<ul> \n" +
                    "<li><a href=\"/OnlineJudge-war/Usuario/VerDatosPersonales.jsp\"><img src=\"/OnlineJudge-war/Images/vpd.png\"></a></li> \n" +
                    "<li><a href=\"/OnlineJudge-war/Usuario/EditarDatosPersonales.jsp\"><img src=\"/OnlineJudge-war/Images/epd.png\"></a></li> \n" +
                    "<li><a href=\"/OnlineJudge-war/Problemas/ListSubmit.jsp\"><img src=\"/OnlineJudge-war/Images/mss.png\"></a></li> \n" +
                    "<li><a href=\"/OnlineJudge-war/Usuario/ListaUsuarios.jsp\"><img src=\"/OnlineJudge-war/Images/ul.png\"></a></li> \n" +
                    "<li><a href=\"/OnlineJudge-war/Usuario/Ranking.jsp\"><img src=\"/OnlineJudge-war/Images/r.png\"></a></li> \n" +
                "</ul> </center>\n" +
                "</div> \n";

        }else{
            bar="<div id=\"search\" > \n" +
                "<form action=\"/OnlineJudge-war/Inicio/doLogin.jsp\" method=\"get\" > \n" +
                "<label><h3>Login</h3></label> \n" +
                "<center> \n" +
                "<table width=\"250\" border=\"0\"> \n" +
                    "<tr> \n" +
                        "<td>Handle</td> \n" +
                        "<td width=\"120\"><input name='handle' id='handle' type=\"text\" value='' size=\"20\" maxlength=\"20\"></td> \n" +
                    "</tr> \n" +
                    "<tr> \n" +
                        "<td>Password</td> \n" +
                        "<td><input name='paswd' id='paswd' type=\"password\" value='' size=\"20\" maxlength=\"20\"></td> \n" +
                    "</tr> \n" +

                    
                 "</table> \n" +
                "<input name=\"goButton\" type=\"submit\" value=\"Login\"> \n" +
                "</center> \n" +
                "</form> \n" +
                mal +
                "</div> \n" +
               
                "<h3>¿Not registered yet?</h3> \n" +
                    "<ul> \n" +
                    "<li><a href=\"/OnlineJudge-war/Registro/Registro.jsp\">Sign in.</a></li> \n" +
                    "</ul> \n" +
                "</div> \n";

        }
    }

    public void setMal(String m){
        mal+=m;
    }

    public void update(boolean log){
        if(log){
            bar="<div id=\"sectionLinks\"> \n" +
                "<center><img src=\"/OnlineJudge-war/Images/main.png\">\n" +
                "<ul> \n" +
                    "<li><a href=\"/OnlineJudge-war/Usuario/VerDatosPersonales.jsp\"><img src=\"/OnlineJudge-war/Images/vpd.png\"></a></li> \n" +
                    "<li><a href=\"/OnlineJudge-war/Usuario/EditarDatosPersonales.jsp\"><img src=\"/OnlineJudge-war/Images/epd.png\"></a></li> \n" +
                    "<li><a href=\"/OnlineJudge-war/Problemas/ListSubmit.jsp\"><img src=\"/OnlineJudge-war/Images/mss.png\"></a></li> \n" +
                    "<li><a href=\"/OnlineJudge-war/Usuario/ListaUsuarios.jsp\"><img src=\"/OnlineJudge-war/Images/ul.png\"></a></li> \n" +
                    "<li><a href=\"/OnlineJudge-war/Usuario/Ranking.jsp\"><img src=\"/OnlineJudge-war/Images/r.png\"></a></li> \n" +
                "</ul> </center>\n" +
                "</div> \n";

        }else{
            bar="<div id=\"search\" > \n" +
                "<form action=\"/OnlineJudge-war/Inicio/doLogin.jsp\" method=\"get\" > \n" +
                "<label><h3>Login</h3></label> \n" +
                "<center> \n" +
                "<table width=\"250\" border=\"0\"> \n" +
                    "<tr> \n" +
                        "<td>Handle</td> \n" +
                        "<td width=\"120\"><input name='handle' id='handle' type=\"text\" value='' size=\"20\" maxlength=\"20\"></td> \n" +
                    "</tr> \n" +
                    "<tr> \n" +
                        "<td>Password</td> \n" +
                        "<td><input name='paswd' id='paswd' type=\"password\" value='' size=\"20\" maxlength=\"20\"></td> \n" +
                    "</tr> \n" +


                 "</table> \n" +
                "<input name=\"goButton\" type=\"submit\" value=\"Login\"> \n" +
                "</center> \n" +
                "</form> \n" +
                mal +
                "</div> \n" +
            "<div class=\"relatedLinks\"> \n" +
                "<h3>¿Not registered yet?</h3> \n" +
                    "<ul> \n" +
                    "<li><a href=\"/OnlineJudge-war/Registro/Registro.jsp\">Sign in!!!</a></li> \n" +
                    "</ul> \n" +
                "</div> \n";

        }
    }

    /**
     * @return the bar
     */
    public String getBar() {
        return bar;
    }


}
